//  复位
function reset(){
	$(".cube").hover(function(){
			$(".cube").addClass('reset');
			$(".cube").removeClass('cube');
		},function(){
			$(".reset").addClass('cube');
			$(".reset").removeClass('reset');
		});
}

//点击停止,暂停-复位
function Restop(){
	$(document).ready(function(){
	  $("#cube").children().click(function(event){
	   		$(this).parent().addClass('reset').removeClass('cube');
	   		 event.stopPropagation();    
	  });

	  $(document).click(function (event) {
	      $(".reset").addClass('cube');
	      $(".reset").removeClass('reset');
	      $('#cube').css({ "-webkit-animation-play-state": 'running' });
	      event.stopPropagation();
	  });
		
	});
}

//点击暂停
function stop(){
	$(document).ready(function(){
	  $("#cube").children().click(function(event){
	   		$(this).parent().css({"-webkit-animation-play-state":'paused'}).addClass('stop');
	   		 event.stopPropagation();    
	  });

		$(document).click(function(event){
			$('#cube').css({"-webkit-animation-play-state":'running'});
			event.stopPropagation(); 
		})
		
	});
}

//仓库
function wharehouse(){
    $(".cube-face-top,.cube-face-bottom").click(function (event) {
        eventShowCk();
        event.stopPropagation();

    });
	remove();
}

//堆场
function yard(){
    $(".cube-face-right,.cube-face-left").click(function (event) {
        eventShowDc();
        event.stopPropagation();
    });
    remove();
}

//码头
function wharf(){
    $(".cube-face-front,.cube-face-back").click(function (event) {
        eventShowMt();
        event.stopPropagation();
    });
	remove();
}

var g_needRegisterRemove = true;
function remove() {
    if (g_needRegisterRemove) {
        $(document).click(function (event) {
            eventShowNone();
            event.stopPropagation();
        });
        g_needRegisterRemove = false;
    }
}

//仓库
function focusCk() {
    $(".cube").addClass("wharehouse").removeClass('cube wharf yard');
}

//堆场
function focusDc() {
    $(".cube").addClass("yard").removeClass('cube wharf wharehouse');
}

function focusMt() {
    $(".cube").addClass("wharf").removeClass('cube');
}
function focusNone() {
    $("#cube").addClass('cube');
    $("#cube").removeClass('wharf yard wharehouse');
    $('#cube').css({ "-webkit-animation-play-state": 'running' });
}
//btn1.click(function()//front face
//{
//	if(cubeParent[0]._gsTransform.rotationX != 0)
//	{
//		TweenMax.to(cubeParent, 1, {rotationX:'0_short'});
//		TweenMax.to(cubeParent, 1, {rotationY:'0_short'});
//		TweenMax.to(cubeParent, 1, {rotation:'0_short'});
//	}
//	else
//	{
//		TweenMax.to(cubeParent, 1, {rotationY:'0_short'});
//		TweenMax.to(cubeParent, 1, {rotation:'0_short'});
//	}
//});
//
//btn2.click(function()//right face
//{
//	if(cubeParent[0]._gsTransform.rotationX != 0)
//	{
//		TweenMax.to(cubeParent, 1, {rotationX:'0_short'});
//		TweenMax.to(cubeParent, 1, {rotationY:'90_short'});
//		TweenMax.to(cubeParent, 1, {rotation:'0_short'});
//	}
//	else
//	{
//		TweenMax.to(cubeParent, 1, {rotationY:'90_short'});
//		TweenMax.to(cubeParent, 1, {rotation:'0_short'});
//	}
//});
//);